package org.lex.elec.model.domain;

import java.util.Date;

import org.lex.elec.model.datatype.HasAtlas;
import org.lex.elec.model.datatype.HasDescription;
import org.lex.elec.model.datatype.HasId;
import org.lex.elec.model.datatype.HasModel;
import org.lex.elec.model.datatype.HasName;

public class Cable extends BaseDomain implements HasId<Integer>, HasName,
		HasModel, HasDescription, HasAtlas {
	private static final long serialVersionUID = 6949133774164588432L;

	private Integer id = null;
	private String model = null;
	private String name = null;
	private Integer workingTemperature = null;
	private Integer atlasId = null;
	private String description = null;
	private Date techCreateDate = null;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getModel() {
		return model;
	}

	public void setModel(String model) {
		this.model = model;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getWorkingTemperature() {
		return workingTemperature;
	}

	public void setWorkingTemperature(Integer workingTemperature) {
		this.workingTemperature = workingTemperature;
	}

	public Integer getAtlasId() {
		return atlasId;
	}

	public void setAtlasId(Integer atlasId) {
		this.atlasId = atlasId;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Date getTechCreateDate() {
		return techCreateDate;
	}

	public void setTechCreateDate(Date techCreateDate) {
		this.techCreateDate = techCreateDate;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((atlasId == null) ? 0 : atlasId.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result + ((model == null) ? 0 : model.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((techCreateDate == null) ? 0 : techCreateDate.hashCode());
		result = prime
				* result
				+ ((workingTemperature == null) ? 0 : workingTemperature
						.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Cable other = (Cable) obj;
		if (atlasId == null) {
			if (other.atlasId != null)
				return false;
		} else if (!atlasId.equals(other.atlasId))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (model == null) {
			if (other.model != null)
				return false;
		} else if (!model.equals(other.model))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (techCreateDate == null) {
			if (other.techCreateDate != null)
				return false;
		} else if (!techCreateDate.equals(other.techCreateDate))
			return false;
		if (workingTemperature == null) {
			if (other.workingTemperature != null)
				return false;
		} else if (!workingTemperature.equals(other.workingTemperature))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "Cable [id=" + id + ", model=" + model + ", name=" + name
				+ ", workingTemperature=" + workingTemperature + ", atlasId="
				+ atlasId + ", description=" + description
				+ ", techCreateDate=" + techCreateDate + "]";
	}
}
